package com.corpgovernment.travelstandard.mapper;


import com.corpgovernment.organization.common.mybatis.TkMapper;
import com.corpgovernment.travelstandard.entity.db.TravelStandardPost;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 差标岗位数据库操作接口类
 **/
@Component
public interface TravelStandardPostMapper extends TkMapper<TravelStandardPost> {

    List<TravelStandardPost> list(TravelStandardPost model);

    /**
     * 根据orgId和tsType查询对应岗位
     *
     * @param tsType
     * @param orgId
     * @return
     */
    List<TravelStandardPost> selectByTsTypeAndOrgId(@Param("tsType") String tsType, @Param("orgId") String orgId);

    /**
     * 获取差标的职级范围
     *
     * @param tsId
     * @return
     */
    List<String> getJobNamesByTsIdAndTsType(@Param("tsId") Long tsId, @Param("tsType") String tsType);

    /**
     * 批量插入
     *
     * @param model
     */
    void insertBatch(List<TravelStandardPost> model);

    int deleteByTsidAndTsType(@Param("tsid") Long tsid, @Param("tsType") String tsType);

    public List<TravelStandardPost> selectByPostIdAndType(@Param("postId") Long postId, @Param("tsType") String tsType);
}